package com.gfeeling.model;

import java.io.Serializable;

/**
 * 资源管理
 * @author lsl
 * @date 2016年7月19日
 * @comment
 * @version 1.0
 */
public class Resource implements Serializable {
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String key1;
	private String name;
	private String menuId;
	/**
	 * 是否选择
	 */
	private boolean isSelected;

	/**
	 * 排序
	 */
	private Integer sort;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getKey1() {
		return key1;
	}

	public void setKey1(String key1) {
		this.key1 = key1;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public boolean isSelected() {
		return isSelected;
	}

	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Resource){
			try{
				Resource r = (Resource)obj ;
				if(this.key1.equals(r.getKey1()) && this.menuId.equals(r.getMenuId())){
					return true ;
				}
			}catch(Exception e){}
		}
		return false ;
	}
}
